home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI1108.ASC < prev    next >
Text File  |  1992-08-17  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                               NUMBER  :  1108
  9.   VERSION  :  4.0
  10.        OS  :  DOS
  11.      DATE  :  August 17, 1992                          PAGE  :  1/2
  12.  
  13.     TITLE  :  Doing a Block Comment in the Text Editor
  14.  
  15.  
  16.  
  17.  
  18.   ┌───────────────────────────────────────────────────────────────┐
  19.   │                                                               │
  20.   │ This Technical Information Sheet is intended only for users   │
  21.   │ who are familiar with PAL.  It contains PAL code to demon-    │
  22.   │ strate a model solution to a specific problem and is not      │
  23.   │ intended to represent a complete programming solution.        │
  24.   │ Programmers who use this code must take responsibility for    │
  25.   │ debugging and developing their application.  Assistance       │
  26.   │ in debugging and developing applications is considered        │
  27.   │ consulting and is beyond the scope of technical support.      │
  28.   │                                                               │
  29.   └───────────────────────────────────────────────────────────────┘
  30.  
  31.   The following code allows a user to comment a section of text
  32.   that has been blocked.  Blocking of text is accomplished by one
  33.   of two ways:
  34.  
  35.      1.  Holding down the mouse button and dragging the cursor over
  36.          the area to be blocked.
  37.  
  38.      2.  Holding down a shift key and using the cursor keys to move
  39.          over the area to be commented.
  40.  
  41.   Play the following script by holding the Alt key, pressing <F10>
  42.   and selecting the Play menu option.  You can also assign a hotkey
  43.   to play this script with the SETKEY command.
  44.  
  45.   EDITOR INFO COMPLETE TO commentbag      ;get current editor info
  46.  
  47.   IF NOT Retval THEN                      ;must not be in an editor session
  48.       BEEP
  49.       QUIT "Block operations not valid in this context"
  50.   ENDIF
  51.  
  52.   IF commentbag["OVERWRITE"] = TRUE THEN  ;Insert or overwrite mode?
  53.           overwrite = True
  54.           INS
  55.   ELSE overwrite = False
  56.   ENDIF
  57.  
  58.   IF commentbag["SELSTART"] = 0 THEN      ;Is there a marked area?
  59.           QUIT "No marked area"
  60.   ENDIF
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                               NUMBER  :  1108
  75.   VERSION  :  4.0
  76.        OS  :  DOS
  77.      DATE  :  August 17, 1992                          PAGE  :  2/2
  78.  
  79.     TITLE  :  Doing a Block Comment in the Text Editor
  80.  
  81.  
  82.  
  83.  
  84.   charlen = commentbag["SELEND"]          ;Get end of marked block
  85.  
  86.   EDITOR GOTO POSITION commentbag["SELSTART"]
  87.                            ;Move to beginning of block
  88.  
  89.   EDITOR INFO COMPLETE TO commentbag
  90.   WHILE commentbag["CHARPOS"] <= charlen
  91.  
  92.           ;While we are not at the end of the original marked block,
  93.           ;mark the current line, extract to a variable, and determine
  94.           ;if the first character is a semicolon. If it's not, then
  95.           ;insert a semicolon at the beginning of the variable, delete
  96.           ;the current line and replace it with the variable.
  97.  
  98.           SHIFTPRESS "end"                ;Mark a line
  99.           EDITOR INFO TO commentbag       ;Get current locations
  100.           EDITOR EXTRACT TO x             ;
  101.  
  102.           IF SUBSTR(x,1,1) <> ";" AND x <> "" THEN
  103.                   x = ";"+x
  104.                   DEL
  105.                   TYPEIN x
  106.           ENDIF
  107.           IF commentbag["SELEND"] = charlen THEN
  108.                   QUITLOOP
  109.           ENDIF
  110.           HOME
  111.           DOWN
  112.   ENDWHILE
  113.   IF overwrite THEN
  114.           INS
  115.   ENDIF
  116.  
  117.   DISCLAIMER: You have the right to use this technical information subject to
  118.   the terms of the No-Nonsense License Statement that you received with the
  119.   Borland product to which this information pertains.
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.